<?php
session_start();
require_once('path.php');
require_once(SOJ_ROOT.'/include/function/lib.php');


if ( empty($_SESSION['fail_message']) ){
	//非法调用本页面
	//@todo 返回首页
	header('Location: ../index.php');
	exit ;
}

$tpl = new my_smarty();

if( !empty($_SESSION['username']) ){
	$tpl->assign( 'username' , $_SESSION['username'] );
}

$tpl->assign( 'fail_message' , $_SESSION['fail_message'] );
//默认回主页, 失败后跳转的页面url
@$tpl->assign( 'url' , $_SESSION['url'] ) ;
@$tpl->assign( 'url_descript' , $_SESSION['url_descript'] );

unset($_SESSION['fail_message']);
unset($_SESSION['url'] );
unset( $_SESSION['url_descript'] );

$tpl->display('fail_handle.tpl');
